package com.movie.ticket.sale.movieinterface.aheadcontroller;

import com.movie.ticket.sale.movieinterface.common.Result;
import com.movie.ticket.sale.movieinterface.parm.UserPram;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @BelongsProject: movie-tickets
 * @BelongsPackage: com.woniu.movietickets.user
 * @Author: lyl
 * @CreateTime: 2020-12-03 10:28
 */
@RestController("movie/user")
@Api(tags = "用户操作(user)",description = "下订单，退款，充值会员，查询评论等功能")
@Slf4j
public class UserController {

/**
*作者:木子
*方法：获取用户信息
*参数： 传入保存的对象
*返回值: user
*/
@ApiOperation("获取用户信息")
    @GetMapping("getOne")
    public Result getOne() {
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：修改用户信息
    *参数： user
    *返回值: result
    */
    @ApiOperation("动态修改用户信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "当前用户 内部获取 不用传",dataType = "String"),
            @ApiImplicitParam(name = "name",value = "更改后的用户名/可以不改",dataType = "String"),
            @ApiImplicitParam(name = "passwrod",value = "更改后的密码/可以不改",dataType = "String"),
            @ApiImplicitParam(name = "age",value = "年龄/可不改",dataType = "String"),
            @ApiImplicitParam(name = "gender",value = "性别/可不改",dataType = "String"),
            @ApiImplicitParam(name = "label",value = "个性化标签/可不改",dataType = "String")

    })
    @PutMapping("changeUser")
    public Result changeUser(UserPram userPram){
        return Result.success();
    }

    /**
     *作者:木子
     *方法：修改用户头像
     *参数： user
     *返回值: result
     */
    @ApiOperation("上传修改头像")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "path",value = "新的图片地址",dataType = "String"),
    })
    @PutMapping("changeUserHead")
    public Result changeUserHead(@RequestParam("path")MultipartFile path){
        return Result.success();
    }

    /**
    *作者:木子
    *方法：查询自己往期评论
    *参数： user
    *返回值: pages
    */
    @ApiOperation("查看自己往期评论")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currPage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("getComments")
    public Result getComments(@RequestParam(defaultValue = "1")int currPage,@RequestParam(defaultValue = "5")int number){
        return Result.success();
    }

    /**
     *作者:木子
     *方法：个人订单查询
     *参数： user内部获取
     *返回值: pages
     */
    @ApiOperation("删除自己往期评论")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "commentId",value = "评论id",dataType="String"),
    })
    @DeleteMapping("deleteComment")
    public Result deleteComment(@RequestParam("commentId")int commentId){
            log.info("传入的评论ID:{}",commentId);
        return Result.success();
    }

    /**
     *作者:木子
     *方法：查询订单状态的方法
     *参数： 订单id
     *返回值: 状态
     */
    @ApiOperation("查询往期订单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currPage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("getUserOrders")
    public Result getUserOrders(@RequestParam(defaultValue = "1")int currPage,@RequestParam(defaultValue = "5")int number){
        return Result.success();
    }
    /**
    *作者:木子
    *方法：查询订单状态的方法
    *参数： 订单id
    *返回值: 状态
    */
    @ApiOperation("查询订单状态")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderId",value = "订单id",dataType="String"),
    })
    @GetMapping("orderState")
    public Result getOrderState(@RequestParam("orderId") int orderId){
        return Result.success(null);
    }

    /**
    *作者:木子
    *方法：该订单下电影票详情
    *参数： 订单Id
    *返回值: 电影票详情
    */
    @ApiOperation("查询某订单下的电影票")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderId",value = "订单id",dataType="String"),
    })
    @GetMapping("getTickets")
    public Result getTickets(@RequestParam("orderId") int orderId){

        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：下单 包括了选座 支付
    *参数：String json的座位号 和 user 内部获取
    *返回值: void
    */
    @ApiOperation("下单")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "seat",value = "json格式的座位号",dataType="String"),
    })
    @PostMapping("addOrder")
    public Result addOrder(@RequestParam("seat") String seat){
        return Result.success();
    }

    /**
    *作者:木子
    *方法：改签
    *参数：需要改签的场次座位号 改签后的座位号 用户ID通国票Id查找
    *返回值:
    */
    @ApiOperation("电影票改签")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticketId",value = "某张需要改签的电影票ID",dataType="String"),
            @ApiImplicitParam(name = "seat",value = "更改后的座位号",dataType="String")
    })
    @PutMapping("changeSeat")
    public Result changeSeat(@RequestParam("ticketId")int ticketId,@RequestParam("seat") String seat){

        return Result.success();
    }
    /**
    *作者:木子
    *方法：退款
    *参数：user
    *返回值: void
    */
    @ApiOperation("退掉某张电影票")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ticketId",value = "某张需要退的电影票ID",dataType="String"),
    })
    @PostMapping("refund")
    public Result refund(@RequestParam("ticketId")int ticketId){
        return Result.success();
    }
    /**
    *作者:木子
    *方法：新增评论
    *参数：orderId user内部获取
    *返回值:
    */
    @ApiOperation("新增评论")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orderId",value = "订单id",dataType="String"),
            @ApiImplicitParam(name = "coment",value = "对某张订单下的电影评论",dataType="String"),
            @ApiImplicitParam(name = "paths",value = "评论图片数组",dataType="String"),
    })
    @GetMapping("getOrder")
    public Result addComment(@RequestParam("orderId")int orderId, @RequestParam("coment")String coment, MultipartFile[] paths){
        return Result.success();
    }
    /**
    *作者:木子
    *方法：查询所有优惠券 userId为0的优惠券
    *参数：
    *返回值: 活动列表
    */
    @ApiOperation("查询所有的优惠券活动")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currPage",value = "当前页码",dataType = "String"),
            @ApiImplicitParam(name = "number",value = "每页展示数量",dataType = "String")
    })
    @GetMapping("getAllDiscounts")
    public Result getAllDiscounts(@RequestParam(defaultValue = "1")int currPage,@RequestParam(defaultValue = "5")int number){
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：参加积分兑换优惠券
    *参数：优惠券的ID user
    *返回值:void
    */
    @ApiOperation("兑换优惠券")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "discountId",value = "某张优惠券的ID",dataType="String"),
    })
    @GetMapping("changeDiscount")
    public Result changeDiscount(@RequestParam("discountId")int discountId){
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：查询自己已经兑换的优惠券
    *参数： user
    *返回值: discount
    */
    @ApiOperation("查询自己所拥有的所有优惠券")
    @GetMapping("getDiscount")
    public Result getDiscount(){
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：查询自己的vip 可能多家影院
    *参数：user
    *返回值: vipList
    */
    @ApiOperation("查看自己所拥有的会员的影院列表")
    @GetMapping("getVip")
    public Result getVip(){
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：购买该影院的vip
    *参数： cinemaId user
    *返回值:
    */
    @ApiOperation("购买某家影院的会员")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cinemaId",value = "电影院的id",dataType="String"),
    })
    @PostMapping("buyVip")
    public Result buyVip(@RequestParam("cinemaId") int cinemaId){

        return Result.success();
    }

    /**
    *作者:木子
    *方法：查询所有拥有vip服务的影院
    *参数：
    *返回值: cinemaList
    */
    @ApiOperation("查询所有的拥有会员服务的影院")
    @GetMapping("getCinemaVip")
    public Result getCinemaVip(){
        return Result.success();
    }
    /**
    *作者:木子
    *方法：登录
    *参数：手机号 密码
    *返回值:void
    */
    @ApiOperation("用户登录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "tel",value = "手机号码",dataType="String"),
            @ApiImplicitParam(name = "password",value = "密码",dataType="String"),
    })
    @GetMapping("login")
    public Result login(@RequestParam("tel")String tel ,@RequestParam("password")String password){
        return Result.success();
    }
    /**
    *作者:木子
    *方法：注册
    *参数： 手机号 密码 验证码
    *返回值: void
    */
    @ApiOperation("用户注册")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "tel",value = "手机号码",dataType="String"),
            @ApiImplicitParam(name = "password",value = "密码",dataType="String"),
            @ApiImplicitParam(name = "code",value = "手机验证码",dataType="String")
    })
    @GetMapping("register")
    public Result register(@RequestParam("tel")String tel ,@RequestParam("password")String password, @RequestParam("code")String code){

        return Result.success();
    }
    /**
    *作者:木子
    *方法：查看自己投诉影院的记录
    *参数： user
    *返回值:
    */
    @ApiOperation("查询往期投诉")
    @GetMapping("getComplaint")
    public Result getComplaint(){
        return Result.success(null);
    }
    /**
    *作者:木子
    *方法：删除投诉
    *参数： complaintId
    *返回值:
    */
    @ApiOperation("删除一个投诉")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "complaintId",value = "投诉Id",dataType="String"),
    })
    @PostMapping("deleteComplaint")
    public Result deleteComplaint(@RequestParam("complaintId") int complaintId ){
        return Result.success();
    }


}
